package org.blue.eventbus;

import java.lang.reflect.Method;

class AnnotatedReceiver {
	private final Object target;
	private final Method method;

	AnnotatedReceiver(Object target, Method method) {
		this.target = target;
		this.method = method;
	}

	<T> void invoke(T eventSource) throws ReflectiveOperationException {
		this.method.setAccessible(true);
		this.method.invoke(target, eventSource);
	}
}
